import type { RegeoDetail } from '@/types/api'

interface RegeoAPIResData {
  status: string
  info: string
  infocode: string
  regeocode: RegeoDetail
}

interface RegeoAPIParams {
  location: string // 经度,纬度
}

export function regeoAPI(params: RegeoAPIParams) {
  return mapHttpInstance.get<RegeoAPIResData, RegeoAPIParams>(
    '/v3/geocode/regeo',
    { params: { key: import.meta.env.VITE_MAP_API_KEY, ...params } },
  )
}
